public class Main {
    public static void main(String[] args) {

        HungrySingletonFactory.getInstance().setName("张三");
        System.out.println(HungrySingletonFactory.getInstance().showInfo());
        System.out.println(HungrySingletonFactory.getInstance().getName());
        System.out.println(HungrySingletonFactory.getInstance().showInfo());

        //懒汉单例
        LazySingletonFactory.getInstance().setName("李四");
        System.out.println(LazySingletonFactory.getInstance().shoInfo());
        System.out.println(LazySingletonFactory.getInstance().getName());
        System.out.println(LazySingletonFactory.getInstance().shoInfo());

    }
}